<!doctype html>
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title>投诉建议</title>
<link href="../../css/newStyle.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript" src="../../js/gbRst.js"></script>
<script type="text/javascript" src="../../js/utils.js"></script>
<script type="text/javascript" src="../../js/openId.js"></script>
<script type="text/javascript" src="../../js/ajaxfileupload.js"></script> 
<script type="text/javascript" src="../../js/header&footer.js"></script>
<script type="text/javascript" src="../../js/check.js"></script>
		<script type="text/javascript" src="../../js/qmsk-1.2.js"></script>
<script type="text/javascript">
function toSaveS(){ 

	var custName=$("#custName").val();
	var phone = $("#phone").val();
	var title = $("#title").val();
	var content = $("#content").val();
	var cmpltTypeName = $("#cmpltTypeName").val();
	if(IsEmpty(custName)){
		alert("姓名不能为空")
		$("#custName").focus();
		return false;		
	}
	if(IsEmpty(phone)){
		alert("手机为空")
		$("#phone").focus();
		return false;		
	}
	
	if(IsEmpty(content)){
		alert("内容不能为空")
		$("#content").focus();
		return false;		
	}
	
	
	
	var heads=new Array("custName","phone","title","content","shopId","cmpltTypeName");
	var datas=new Array(custName,phone,title,content,_shopId,cmpltTypeName);
	var parser = new Object();
	var jsonParserStr = null;
	if (IsNotEmpty(datas)){
		addToParser(heads, datas, "add" , parser);
		jsonParserStr =  JSON.stringify(parser);
	}
	
	$.post("../../../complnt/insert/insertInfo",{"data":jsonParserStr}, function(data) {
		var dt = JSON.parse(data);	
				 if(IsEmpty(dt)){
					alert("操作出错")
					return false;
				}
				if(dt.state==0){
					alert("操作成功")
					restForm();
				}else if(dt.state==1){
					alert("操作出错")
				}
		
	});
}

function restForm(){
	$("#isMember").val(1);
	$("#custName").val("");
	$("#phone").val("");
	$("#title").val("");
	$("#content").val("");
	$("#searchM").hide();
	
}
</script>
</head>

<body>
<div class="wrapper">
  <div class="container">
  <div class="placeTit"><a href="javascript:history.go(-1)" class="back"></a>投诉建议</div>
  		<div class="person">
        	类型<span class="red">*</span><br>
            <select id="cmpltTypeName"><option value="投诉">投诉</option><option value="建议">建议</option></select>
        </div>
        <div class="person">
            姓名/昵称<span class="red">*</span><br>
            <input name="custName" id="custName" type="text" class="txt">
        </div>
        <div class="person">
            手机<span class="red">*</span><br>
            <input name="custName" type="text" id="phone" class="txt">
        </div>
        <div class="person">
            主题<span class="red">*</span><br>
            <input name="custName" type="text" id="title" class="txt">
        </div>
        <div class="person">
            内容<span class="red">*</span><br>
            <textarea id="content"></textarea>
        </div>
        <div class="give">
            <input type="button" value="提交申请" class="giveBtn" onclick="toSaveS()">
        </div>
  </div>
</div>
</body>
</html>
